from AccessControl import ClassSecurityInfo
from Globals import InitializeClass


class MapData:
    
    security = ClassSecurityInfo()
    security.setDefaultAccess( "allow" )
    
    def __init__( self, lat, long, zoom, address="", notes="" ):
        """ Initialize the MapData object """
        
        self.lat = lat
        self.long = long
        self.zoom = zoom
        self.address = address
        self.notes = notes
        
    def getLat(self):
        """ Gets the latitude """
        
        return self.lat
    
    def getLong(self):
        """ Gets the longditude """
        
        return self.long
    
    def getAddress(self):
        """ Returns the address, if any """
        
        return self.address
        
    def getNotes(self):
        """ Returns the notes, if any """
        
        return self.notes
    
    def getZoom(self):
        """ Returns the zoom level """
        
        return self.zoom
    
    def __str__(self):
        """ Serialize this mapdata for the database """
        
        return "%s:%s:%s:%s:%s" % ( self.lat, self.long, self.zoom, self.address, self.notes )
    
InitializeClass( MapData )